#include <bits/stdc++.h>
#define int long long 
const int N = 5e5 + 5; 
using namespace std; 
int n, ans; 
struct Node {
	int x, y; 
} a[N];
bool cmp(Node p, Node q) {
	return p.x ^ q.x ? p.x < q.x : p.y < q.y; 
}
inline void solve() {
	cin >> n; 
	for(int i = 1; i <= n; ++i) cin >> a[i].x >> a[i].y; 
	sort(a + 1, a + n + 1, cmp); 
	int L = a[n].x - a[1].x + 1, H = a[n].y - a[1].y + 1; 
	for(int i = 1, l, r, ls; i <= H; ++i)
		for(int j = 1; j <= L; ++j) {
			l = j - 1; l = l * (l + 1) / 2; 
			r = L - j; r = r * (r + 1) / 2; 
			ls = (l + r) * H; 
			l = i - 1; l = l * (l + 1) / 2; 
			r = H - i; r = r * (r + 1) / 2; 
			ls += (l + r) * L; 
			ans += ls; 
		}
	cout << ans / 2 << "\n"; 
	return ; 
}
signed main() {
	freopen("game.in", "r", stdin); 
	freopen("game.out", "w", stdout); 
	ios::sync_with_stdio(false); 
	cin.tie(0); cout.tie(0); 
	solve(); 
	return 0; 
}
